package com.huaxin.device.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.huaxin.device.dto.enums.validation.ValidEquipmentStatus;
import com.huaxin.device.dto.request.base.BasePageReqDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = true)
public class ElectricalEquipmentPageListReqDTO extends BasePageReqDTO {

    @Schema(description = "设备名称关键字", example = "变压器")
    private String equipmentName;

    @Schema(description = "设备编号", example = "EQP-TR-001")
    private String equipmentCode;

    @Schema(description = "型号ID", example = "m123e456-789a-bcde-f012-3456789abcde")
    private String modelId;

    @Schema(description = "分类ID", example = "c123e456-789a-bcde-f012-3456789abcdf")
    private String categoryId;

    @Schema(description = "运行状态：normal/fault/maintenance/repair/offline", example = "normal")
    @ValidEquipmentStatus
    private String status;

    @Schema(description = "所属配电房ID", example = "r123e456-789a-bcde-f012-3456789abcde")
    private String roomId;

    @Schema(description = "所属电井ID", example = "w123e456-789a-bcde-f012-3456789abcde")
    private String wellId;

    @Schema(description = "所属变电箱ID", example = "cb123e456-789a-bcde-f012-3456789abcde")
    private String cabinetId;

    @Schema(description = "安装日期起", example = "2023-01-01 00:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime installDateStart;

    @Schema(description = "安装日期止", example = "2023-12-31 23:59:59")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime installDateEnd;

    @Schema(description = "组织ID", example = "org-01")
    private String orgId;

    @Schema(description = "家庭ID", example = "family-01")
    private String familyId;
}